#include "win/msg_loop.h"
#include "win/thread_manager.h"
#include "maindlg.h"

int WINAPI WinMain( HINSTANCE hInstance
                   , HINSTANCE hPrevInstance
                   , LPSTR lpCmdLine
                   , int nShowCmd )
{
    CMainDlg impl;
    impl.Parse( L"maindlg.xml" );
    RECT rect = { 0, 0, 400, 400 };
    impl.Create( NULL, &rect );
    impl.ShowWindow( SW_SHOWNORMAL );
    impl.UpdateWindow();

    MessageLoopAM* pLoop = new MessageLoopAM;
    pLoop->Run( INFINITE );
    ThreadManager::Instance().SetAnimateQueue(pLoop);

    ThreadManager::Instance().SetMessageQueue( new MessageLoopUI );
    ThreadManager::Instance().MessageQueue()->Run();

    return 0;
}